<extend name="Public/base" />
<block name="content">
<div id="content" style="min-width:800px;">
	<div id="content-header">
		<div id="breadcrumb">
			<a href="{:U('Index/index')}" title="首页" class="tip-bottom"><i
				class="icon-home"></i> 首页</a> <a href="#" class="current">{$meta_title}</a>
		</div>
	</div>
	
	<div class="container-fluid search-form">
			<form class="m-filter" autocomplete="off">
				<div class="clearfix">
					<a class="pull-left btn btn-success btn-filter-show" id="j-filter-show"><span class="icon-chevron-down"></span></a>
				</div>
				
				<div class="filter-box" id="j-filter-box">
					<!-- 基础信息 -->
					<div class="filter-base filter-group">
						<a class="title"><span class="icon-list"></span> 基础信息</a>
						<span class="control-group">
							<select class="form-control" style="width: 150px;" name="activity_id" id="activity_id" onchange="change_merchant(activity_id, '{:U('Shop/getActivityMerchant')}')">
								<option value=0>选择活动</option>
								<volist name="activity_list" id="vo">
									<option value='{$vo.activity_id}'>{$vo.activity_name|strip_tags}</option>
								</volist>
								{$Think.config.ACTIVITY_TTTM}
							</select>
						</span>
					</div>
					<br />
					<!-- 申请核销日期 -->
					<div class="filter-date filter-group clearfix">
						<a class="title"><span class="icon-calendar"></span> 申请核销日期</a>
					  	<div class="control-group pull-left">
					    	<div class="controls">
					      		<input type="text" id="apply_start_time" name="apply_start_time" readonly="readonly" class="datepicker" value="{:strip_tags(I('apply_start_time'))}" placeholder="开始时间" style="width:120px; text-align:center;" >
					    	</div>
					  	</div>
					  	<div class="control-group pull-left" style="margin-left:15px;">
					    	<div class="controls">
					      		<input type="text" id="apply_end_time" name="apply_end_time" readonly="readonly" class="datepicker" value="{:strip_tags(I('apply_end_time'))}" placeholder="结束时间" style="width:120px; text-align:center;" >
					    	</div>
					  	</div>　<button type="button" id="a_time" class="btn btn-warning">清除</button>
					</div>
					<!-- /申请核销日期 -->
					
					<div class="clearfix btn-group">
						<a class="btn btn-success btn pull-left" id="j-filter-hide" style="margin-left:15px;"><span class="icon-chevron-up"></span></a>
						<button type="button" id="search_button" url="{:U('CheckOrder/applyShopList')}" class="btn btn-primary btn pull-left"><span class="icon-search"></span></button>
					</div>	
				</div>		
			</form>
		</div>
	
	
	
	
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-content">
						<notempty name="apply_shop">
							<table class="table table-bordered table-striped">
								<thead>
									<tr>
										<th nowrap="nowrap">序号</th>
										<th nowrap="nowrap">店铺</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<volist name="apply_shop" id="vo">
										<tr>
											<td class="taskStatus">{$i}</td>
											<td class="taskStatus">{$vo.shop_name|htmlspecialchars}</td>
											<td class="taskStatus"><a href="{:U('CheckOrder/checkOrderList', array('activity_id'=>$vo['activity_id'],'merchant_id'=>$vo['merchant_id'],'shop_id'=>$vo['shop_id'],'order_status'=>$vo['order_status'],'apply_start_time'=>strip_tags(I('apply_start_time')),'apply_end_time'=>strip_tags(I('apply_end_time'))))}" class="btn btn-mini btn-info">订单质检</a></td>
									</volist>
								</tbody>
							</table>
							<notempty name="_total">
								<div class="control-group" style="text-align:right;">
									共：<span id="order_sum">{$_total|default='0'}</span> 店铺  
								</div>
							</notempty>
							<div class="dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_full_numbers" id="DataTables_Table_0_paginate">
								{$_page}
							</div>
						<else/>
							<center>请根据搜索条件进行查询</center>
						</notempty>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(function (){
	//日期控件
	$(".datepicker").datetimepicker({
		format: 'yyyy-mm-dd hh:ii', 
	    autoclose: true,
	    todayBtn: true
	});
	//条件框
	$("#j-filter-hide").click(function(){
		$("#j-filter-box").fadeOut(300);
		$("#j-filter-show").fadeIn(300);
	});
	$("#j-filter-show").click(function(){
		$("#j-filter-box").fadeIn(300);
		$(this).fadeOut(300);
	});
	
	//clear
	$('#a_time').click(function(){
		$('#apply_start_time,#apply_end_time').val('');
	});
	$('#b_time').click(function(){
		$('#back_start_time,#back_end_time').val('');
	});
	
	//导出
	$(".export").click(function(){
		if(!confirm('是否要导出数据？')){
			return false;
		}
		$('.export').attr('disabled', true);
		var url = $(this).attr('url');
		$.post(url, $('form').serialize(), call_back, "json");
		return false;
		function call_back(data){
			$('.export').removeAttr('disabled');
			if(data.status == 1){
				window.location.href = data.info;
			}else{
				tke_alert(data.info, 'alert-error', 5000);
			}
		}
	});
	
	set_value("activity_id",'{:I('activity_id')}')
	set_value("merchant_id",'{:I('merchant_id')}')
	set_value("shop_id",'{:I('shop_id')}')
	set_value("order_status",'{:I('order_status')}')
	set_value("order_type",'{:I('order_type')}')
	set_value("coupons_type",'{:I('coupons_type', -1)}')
	
	//默认活动
	if("0" != "{:C('JJHH_ACTIVITY_ID')}" && "{:I('activity_id')}"==0){
		set_value('activity_id', "{:C('JJHH_ACTIVITY_ID')}");
		change_merchant(activity_id, "{:U('Shop/getActivityMerchant')}");
	}
});

//导航高亮
highlight_subnav("{:U('CheckOrder/applyShopList')}");
</script>
</block>